home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Debug / DebugMessage.h < prev    next >
Encoding:
Text File  |  1998-03-12  |  1.1 KB  |  46 lines  |  [TEXT/CWIE]

  1. // DebugMessage.h
  2.  
  3. #ifndef DebugMessage_h
  4. #define DebugMessage_h
  5.  
  6. #ifndef Integers_h
  7. #include "Integers.h"
  8. #endif
  9.  
  10. class ConstData;
  11.  
  12. class DebugMessage
  13.   {
  14.     private:
  15.         static uint8 message[ maxuint8 + 2 ];
  16.         
  17.         uint8& Length()                            { return message[0]; }
  18.         const uint8& Length() const            { return message[0]; }
  19.         
  20.         const uint8 *PascalString() const    { return message; }
  21.         const char *CString() const            { return reinterpret_cast<const char *>(message+1); }
  22.         
  23.     public:
  24.         DebugMessage();
  25.         DebugMessage( const char * );
  26.         
  27.         DebugMessage& operator<<( const char * );
  28.         DebugMessage& operator<<( ConstData );
  29.         DebugMessage& operator<<( uint32 );
  30.         DebugMessage& operator<<( int32 );
  31.         DebugMessage& operator<<( void * );
  32.  
  33.         DebugMessage& operator<<( uint16 n )    { return *this << uint32( n ); }
  34.         DebugMessage& operator<<( int16 n )        { return *this << int32( n ); }
  35.         DebugMessage& operator<<( uint8 n )        { return *this << uint32( n ); }
  36.         DebugMessage& operator<<( int8 n )        { return *this << int32( n ); }
  37.         
  38.         inline void Show();
  39.   };
  40.  
  41. #ifndef ShowDebugMessage_h
  42. #include "ShowDebugMessage.h"
  43. #endif
  44.  
  45. #endif
  46.